3. NMAP

Nmap (“Network Mapper”) is an open source tool for network exploration (mapping) and security auditing.
It contains variety of useful tools for network footprinting.
It is used for scanning and information gathering.
It uses raw IP packets in novel ways for the following purposes:

NMAP commands syntax

sudo nmap [OPTIONS] [TARGET]


  1. Ping Sweeps and active machine identification
    Ping sweeps helps to discover computers on your subnet without knowing their IP address.
  1. To check if the host is available and
  2. To measure how long the response takes.

Syntax

sudo nmap -sP [TARGET]

sudo nmap -sP 192.168.1.0/24

Pinging Metasploitable 2 subent

a7de6c5da2f23cb532e6db2d2a8a7157.png


  1. Port Scanning
    To see the ports on which active hosts are accepting connections. It helps to verify that software firewalls and other security measures are implemented properly. It also helps in understanding the purpose of the active machine for example if a host is accepting connections on port 80 we can assume it’s purpose to be of a HTTP web server or network device with a web interface (router,firewall,access point).

Syntax

sudo nmap -p [PORT] [TARGET]

Only scan specified ports

Scanning Metasploitable 2 for port 80 (HTTP)

3e3af2bfe57a79577b3743a40cc47bb0.png

If FILTERED is written under the STATE column it means the port is closed and not accepting connections.

0df2a2d013b6e8dfae7e3f0a4722a832.png


  1. Identifying operating systems
    It will help us to see host operating system and other device type information(MAC address,NIC manufacturer,OS version,device type).We can use this information to find exploits for the host OS.

Syntax

sudo nmap -O [TARGET]

Metasploitable 2 OS identification

bd2f2bba548bd36d6ee75db33caa76aa.png